<?php

	if($_POST)
	{
		$data = array('nickname'=>$_POST['nickname'],'email'=>$_POST['email'],'phone'=>$_POST['phone'],'password'=>md5($_POST['password']),'level'=>1,'addtime'=>time());
		$location = $_->users->_insert($data)?'http://my.pic.dev':'';
		if($location)
		{
			$uinfo = $_->users->_update(array('status'=>0),array('email'=>$data['email'])) ? $_->users->_select('*',array('email'=>$data['email'])):"";
			session_start();
			cookie(array('_time'=>time()),$time = 3600);
			$_SESSION['userinfo'] = $uinfo[0];
		}
		header("Location: $location");exit;
	}

	$smarty->_display();
?>